import request from "./request";

/**
 * 获取文章列表
 */
export const getArticles = () => {
  return request({
    method: "GET",
    url: "/articles",
  });
};

/**
* 获取文章分类
*/
export const getCategorys = () => {
  return request({
    method: "GET",
    url: "/categorys",
  });
};

/**
* 获取删除文章
*/
export const deleteArticles = (id) => {
  return request({
    method: "DELETE",
    url: `/articles/${id}`,
  });
};
/**
* 修改文章
*/
export const cerrArticles = (id) => {
  return request({
    method: "PUT",
    url: `/articles_corr/${id}`,
  });
};
/**
* 根据id获取单个文章原始内容
*/
export const queryOriginArticlesItem = (id) => {
  return request({
    method: "GET",
    url: `/articles/origin/${id}`,
  });

};
/**
* 根据id获取单个文章内容
*/
export const queryArticlesItem = (id) => {
  return request({
    method: "GET",
    url: `/articles/${id}`,
  });
};